home *** CD-ROM | disk | FTP | other *** search
/ Aminet 8 / Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso / Aminet / dev / gcc / gcc270_src.lha / gcc-2.7.0-amiga / config / i386 / winnt.h < prev    next >
C/C++ Source or Header  |  1995-06-15  |  5KB  |  153 lines

  1. /* Operating system specific defines to be used when targeting GCC for
  2.    Windows NT 3.x on an i386.
  3.    Copyright (C) 1994, 1995 Free Software Foundation, Inc.
  4.    Contributed by Douglas B. Rupp (drupp@cs.washington.edu).
  5.  
  6. This file is part of GNU CC.
  7.  
  8. GNU CC is free software; you can redistribute it and/or modify
  9. it under the terms of the GNU General Public License as published by
  10. the Free Software Foundation; either version 2, or (at your option)
  11. any later version.
  12.  
  13. GNU CC is distributed in the hope that it will be useful,
  14. but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. GNU General Public License for more details.
  17.  
  18. You should have received a copy of the GNU General Public License
  19. along with GNU CC; see the file COPYING.  If not, write to
  20. the Free Software Foundation, 59 Temple Place - Suite 330,
  21. Boston, MA 02111-1307, USA. */
  22.  
  23. #define YES_UNDERSCORES
  24.  
  25. #include "i386/gas.h"
  26.  
  27. #ifdef CPP_PREDEFINES
  28. #undef CPP_PREDEFINES
  29. #endif
  30. #define CPP_PREDEFINES "-Dunix -Di386 -DWIN32 -D_WIN32 \
  31.   -DWINNT -D_M_IX86=300 -D_X86_=1 -D__STDC__=0 -DALMOST_STDC -D_MSC_VER=800 \
  32.   -D__stdcall=__attribute__((__stdcall__)) \
  33.   -D__cdecl=__attribute__((__cdecl__)) \
  34.   -Asystem(unix) -Asystem(winnt) -Acpu(i386) -Amachine(i386)"
  35.  
  36. #define SIZE_TYPE "unsigned int"
  37. #define PTRDIFF_TYPE "int"
  38. #define WCHAR_UNSIGNED 1
  39. #define WCHAR_TYPE_SIZE 16
  40. #define WCHAR_TYPE "short unsigned int"
  41. #undef LONG_DOUBLE_TYPE_SIZE
  42. #define LONG_DOUBLE_TYPE_SIZE 64
  43. #define HAVE_ATEXIT 1
  44.  
  45. #undef EXTRA_SECTIONS
  46. #define EXTRA_SECTIONS in_ctor, in_dtor
  47.  
  48. #undef EXTRA_SECTION_FUNCTIONS
  49. #define EXTRA_SECTION_FUNCTIONS                    \
  50.   CTOR_SECTION_FUNCTION                        \
  51.   DTOR_SECTION_FUNCTION
  52.  
  53. #define CTOR_SECTION_FUNCTION                    \
  54. void                                \
  55. ctor_section ()                            \
  56. {                                \
  57.   if (in_section != in_ctor)                    \
  58.     {                                \
  59.       fprintf (asm_out_file, "\t.section .ctor\n");        \
  60.       in_section = in_ctor;                    \
  61.     }                                \
  62. }
  63.  
  64. #define DTOR_SECTION_FUNCTION                    \
  65. void                                \
  66. dtor_section ()                            \
  67. {                                \
  68.   if (in_section != in_dtor)                    \
  69.     {                                \
  70.       fprintf (asm_out_file, "\t.section .dtor\n");        \
  71.       in_section = in_dtor;                    \
  72.     }                                \
  73. }
  74.  
  75. #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME)    \
  76.   do {                        \
  77.     ctor_section ();                \
  78.     fprintf (FILE, "%s\t", ASM_LONG);        \
  79.     assemble_name (FILE, NAME);            \
  80.     fprintf (FILE, "\n");            \
  81.   } while (0)
  82.  
  83. #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME)           \
  84.   do {                        \
  85.     dtor_section ();                           \
  86.     fprintf (FILE, "%s\t", ASM_LONG);        \
  87.     assemble_name (FILE, NAME);                  \
  88.     fprintf (FILE, "\n");            \
  89.   } while (0)
  90.  
  91. /* Define this macro if references to a symbol must be treated
  92.    differently depending on something about the variable or
  93.    function named by the symbol (such as what section it is in).
  94.  
  95.    On i386, if using PIC, mark a SYMBOL_REF for a non-global symbol
  96.    so that we may access it directly in the GOT.
  97.  
  98.    On i386 running Windows NT, modify the assembler name with a suffix 
  99.    consisting of an atsign (@) followed by string of digits that represents
  100.    the number of bytes of arguments passed to the function, if it has the 
  101.    attribute STDCALL. */
  102.  
  103. #ifdef ENCODE_SECTION_INFO
  104. #undef ENCODE_SECTION_INFO
  105. #define ENCODE_SECTION_INFO(DECL)                     \
  106. do                                    \
  107.   {                                    \
  108.     if (flag_pic)                            \
  109.       {                                    \
  110.     rtx rtl = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd'        \
  111.            ? TREE_CST_RTL (DECL) : DECL_RTL (DECL));        \
  112.     SYMBOL_REF_FLAG (XEXP (rtl, 0))                    \
  113.       = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd'            \
  114.          || ! TREE_PUBLIC (DECL));                    \
  115.       }                                    \
  116.     if (TREE_CODE (DECL) == FUNCTION_DECL)                 \
  117.       if (lookup_attribute ("stdcall",                    \
  118.                 TYPE_ATTRIBUTES (TREE_TYPE (DECL))))    \
  119.         XEXP (DECL_RTL (DECL), 0) =                     \
  120.           gen_rtx (SYMBOL_REF, Pmode, gen_stdcall_suffix (DECL));     \
  121.   }                                    \
  122. while (0)
  123. #endif
  124.  
  125. /* The global __fltused is necessary to cause the printf/scanf routines
  126.    for outputting/inputting floating point numbers to be loaded.  Since this
  127.    is kind of hard to detect, we just do it all the time. */
  128.  
  129. #ifdef ASM_FILE_START
  130. #undef ASM_FILE_START
  131. #endif
  132. #define ASM_FILE_START(FILE) \
  133.   do {    fprintf (FILE, "\t.file\t");                \
  134.     output_quoted_string (FILE, dump_base_name);        \
  135.     fprintf (FILE, "\n");                    \
  136.         fprintf (FILE, ".global\t__fltused\n");            \
  137.   } while (0)
  138.  
  139. /* if the switch "-mwindows" is passed to ld, then specify to the Microsoft
  140.    linker the proper switches and libraries to build a graphical program */
  141.  
  142. #undef LIB_SPEC
  143. #define LIB_SPEC "%{mwindows:-subsystem:windows -entry:WinMainCRTStartup \
  144.   USER32.LIB GDI32.LIB COMDLG32.LIB WINSPOOL.LIB} \
  145.  %{!mwindows:-subsystem:console -entry:mainCRTStartup} \
  146.  %{mcrtmt:OLDNAMES.LIB LIBCMT.LIB KERNEL32.LIB ADVAPI32.LIB} \
  147.  %{!mcrtmt:OLDNAMES.LIB LIBC.LIB KERNEL32.LIB ADVAPI32.LIB} \
  148.  %{g:-debugtype:coff -debug:full} \
  149.  %{v}"
  150.  
  151. #include "winnt/winnt.h"
  152.  
  153.